<template>
  <ul class="history-operation-view">

    <li class="operation-item" v-for="item in datas" :key="item.id">
      <div class="item-left">
        <el-image class="pic" :src="item.image">
          <div slot="error" class="image-slot"
               style="width:100%;height:100%;display:flex;justify-content:center;align-items:center;">
            <i class="el-icon-user-solid" style="font-size:24px;color:#666;"></i>
          </div>
        </el-image>
      </div>

      <div class="item-right">

        <div class="item-right-top">

          <span class="name">{{item.user_name}}</span>
          <span class="date">{{item.operation_time}}</span>

          <a class="audit-txt" @click="auditClick(item.flow_id)" v-if="item.flow_id && item.SerialNumber">{{item.SerialNumber}}</a>

        </div>

        <div class="item-right-content">
          <span>{{item.operation_content}}</span>
        </div>

      </div>
    </li>

  </ul>
</template>

<script>
    export default {
        name: "index",
        props:{
            datas:{
                type:Array,
                default:function () {
                    return[]
                }
            },
            to:{
                type:Object,
                default:function () {
                    return null
                }
            }
        },
        methods:{
            auditClick:function (id) {
                if (this.to){
                    this.to.query = {id:id}
                    this.$router.push(this.to)
                }
            }
        }
    }
</script>

<style lang="scss" scoped>
  @import "../../assets/scss/components/historyView.scss";
</style>
